#define _CRT_SECURE_NO_WARNINGS


#include<iostream>
#include<string>
using namespace std;
class Solution {
public:
    Solution(string s, int k)
        :s1(s)
        , k1(k)
    {

    }

    string reverseStr(string s, int k) {
        int length = s.size();
        for (int i = 0; i < length; i += 2 * k) {
            reverse(s.begin() + i, s.begin() + min(i + k, length));
        }
        return s;
    }
private:
    string s1;
    int k1;
};

int main()
{
    string s = "abcdefg";
    Solution sn(s, 2);
    sn.reverseStr(s, 2);
    return 0;
}